package javacommon.authority.model;

import java.util.List;

import com.jfinal.plugin.activerecord.Model;

public class Role extends Model<Role>{
	public static final Role dao = new Role();

	public List<Role> findByUserId(String id) {
		return dao.find("select id,name from t_role where id in (select roleId from t_user_role where userId=?)",
				id);
	}

	public List<Role> findAll() {
		return dao.find("select * from t_role");
	}
}
